package com.cn.daimajiangxin.flink.sink;

import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class BasicSinkDemo {
    public static void main(String[] args) throws Exception {
        // 创建执行环境
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        // 创建数据源
        DataStream<String> stream = env.fromData("Hello", "Flink", "Sink");

        // 打印到标准输出
        stream.print("StandardOutput");

        // 打印到标准错误输出
        stream.printToErr("ErrorOutput");

        // 执行作业
        env.execute("Basic Sink Demo");
    }
}
